<?phpclass Logger{	var $phpFile = null;	var $logPath = null;	var $level = 5;	var $types = array("ERROR"=>1,  "WARN"=>2, "INFO"=>3, "DEBUG"=>4, "ALL"=>5);		function __construct($phpFile, $level=5, $logPath=null){		$this->phpFile = $phpFile;		$this->level = $level;		$this->logPath = $logPath;	}		function log($msg, $type="ALL"){		if(array_key_exists($type,$this->types) && $this->types[$type] <= $this->level){			$log_str = "[".date("Y-m-d H:i:s")."]\t".$type." \t<".$this->phpFile.">:\t".$msg."\n";			$logFile = $this->logPath."/app_".date("Y-m-d").".log";			@file_put_contents($logFile,$log_str,FILE_APPEND); 		}	}		function info($msg){		$this->log($msg, "INFO");	}		function debug($msg){		$this->log($msg, "DEBUG");	}		function warn($msg){		$this->log($msg, "WARN");	}		function error($msg){		$this->log($msg, "ERROR");	}}